home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / GetFrame.java < prev    next >
Text File  |  1998-08-01  |  484b  |  22 lines

  1. package com.symantec.itools.util;
  2.  
  3. import java.awt.*;
  4.  
  5. public class GetFrame {
  6.  
  7.     /**
  8.      * Finds the frame that encloses an applet, or if one can't be found,
  9.      * creates a new frame.
  10.      */
  11.     public static Frame find(Container container) {
  12.         Container theFrame = container;
  13.         do {
  14.             theFrame = theFrame.getParent();
  15.         } while ((theFrame != null) && !(theFrame instanceof Frame));
  16.         if (theFrame == null)
  17.             theFrame = new Frame();
  18.         return (Frame) theFrame;
  19.     }
  20.  
  21. }
  22.